package edu.pku.sei.act.actools;

import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

public class ACTools extends Activity {
	
	private ICapabilityManager CapabilityManager;
	
	private ServiceConnection mConnection = new ServiceConnection() {

		public void onServiceConnected(ComponentName arg0, IBinder arg1) {
			
			CapabilityManager = ICapabilityManager.Stub.asInterface(arg1);
			Log.v("@jjj","onServiceConnected");
		}

		public void onServiceDisconnected(ComponentName name) {
			
			CapabilityManager = null;
			Log.v("@jjj","onServiceDisconnected");
		}
	};
	
	TextView labelView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_actools);
        
        
        String result = "NO";
//        try {
//			result = CapabilityManager.invokeCapability(null, null);
//		} catch (RemoteException e) {
//			e.printStackTrace();
//		}

        
        labelView = (TextView)findViewById(R.id.textView1);
        labelView.setText(result);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_actools, menu);
        return true;
    }
}
